package net.mihome.app.bean;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import net.mihome.app.AppException;
import net.mihome.app.bean.net.ResponsePojo;

public class AdvertList  extends Entity{
	private int pageSize;
	private int activeCount;
	private List<Advert> advertList = new ArrayList<Advert>();
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getActiveCount() {
		return activeCount;
	}
	public void setActiveCount(int activeCount) {
		this.activeCount = activeCount;
	}
	public List<Advert> getAdvertList() {
		return advertList;
	}
	public void setAdvertList(List<Advert> advertList) {
		this.advertList = advertList;
	}
	public static AdvertList parse(ResponsePojo responsePojo ) {
		AdvertList advertList = new AdvertList();
		List list=(List) responsePojo.getData();
		if(list!=null&&!list.isEmpty()){
			Iterator iterator=list.iterator();
			while(iterator.hasNext()){
				Map map=(Map) iterator.next();
				Advert advert=Advert.parse(map);
				advertList.getAdvertList().add(advert);
			}
		}
        return advertList;       
	}
	
}
